package com.cqie.rbac.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cqie.rbac.entity.QuotaOptions;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 字典表 Mapper 接口
 * </p>
 *
 * @author 夏兵
 * @since 2021-10-11
 */
public interface QuotaOptionsMapper extends BaseMapper<QuotaOptions> {

    @Insert({"<script>",
            "INSERT INTO quota_options ( option_name, option_score, quota_id )\n" +
                    "VALUES\n" +
                    "<foreach collection=\"optionList\" item=\"item\" separator=\",\">" +
                    "(#{item.optionName}, #{item.optionScore}, #{item.quotaId})" +
                    "</foreach>"
            , "</script>"})
    int insertBatchOption(@Param("optionList") List<QuotaOptions> quotaOptionsList);
}
